package com.zenithmind.user.pojo.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * 租户信息VO
 * 
 * @author ZenithMind
 * @since 2024-06-30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "租户信息返回对象")
public class TenantVO {

    @Schema(description = "租户ID")
    private String id;

    @Schema(description = "租户编码")
    private String tenantCode;

    @Schema(description = "租户名称")
    private String tenantName;

    @Schema(description = "租户类型（1-企业版，2-个人版，3-试用版）")
    private Integer tenantType;

    @Schema(description = "租户类型名称")
    private String tenantTypeName;

    @Schema(description = "租户域名")
    private String domain;

    @Schema(description = "租户Logo")
    private String logo;

    @Schema(description = "联系人姓名")
    private String contactName;

    @Schema(description = "联系人电话")
    private String contactPhone;

    @Schema(description = "联系人邮箱")
    private String contactEmail;

    @Schema(description = "租户地址")
    private String address;

    @Schema(description = "状态（0-禁用，1-启用，2-试用，3-过期）")
    private Integer status;

    @Schema(description = "状态名称")
    private String statusName;

    @Schema(description = "到期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expireTime;

    @Schema(description = "最大用户数")
    private Integer maxUsers;

    @Schema(description = "当前用户数")
    private Integer currentUsers;

    @Schema(description = "存储配额（字节）")
    private Long storageQuota;

    @Schema(description = "存储配额（格式化）")
    private String storageQuotaFormatted;

    @Schema(description = "已用存储（字节）")
    private Long storageUsed;

    @Schema(description = "已用存储（格式化）")
    private String storageUsedFormatted;

    @Schema(description = "存储使用率（百分比）")
    private Double storageUsageRate;

    @Schema(description = "功能特性配置")
    private String features;

    @Schema(description = "租户设置")
    private String settings;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "是否即将到期")
    private Boolean isExpiringSoon;

    @Schema(description = "剩余天数")
    private Long remainingDays;
}
